---
title: "SQL-023: CP policy in group"
summary: Check whether a policy belongs to a group and chapter context.
status: draft
owner: SAIF Corporation
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
---

# SQL-023 CP policy in group

This stored procedure call checks whether a policy belongs to the current group and chapter context so group-based authorization can allow access to the policy.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-023 |
| **Operation type** | Read |
| **Execution method** | StoredProc |
| **Database** | SQL Server (BDS) |
| **Schema** | `[unqualified]**` |
| **Command type** | StoredProcedure |
| **Business object** | `clsPolicySecurity` |
| **Criteria property** | `N/A` |
| **Lifecycle method** | `IsInGroup` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `@groupID` | Input | Decimal | N/A | Group identifier for the current user context. |
| `@Chapters` | Input | String | N/A | Chapter code list used to scope the group membership check. |
| `@policyNum` | Input | Decimal | N/A | Policy number being validated for group access. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| N/A — Stored procedure | SELECT | Procedure body resides in the database. |

## Sample SQL

```sql
-- SQL Server (BDS) stored procedure call (CommandType.StoredProcedure, Scalar)
-- clsPolicySecurity.IsInGroup, executed against DPISql (clsSQLDataLayer)
EXEC cp_policy_in_group
  @groupID   = @groupID,
  @Chapters  = @Chapters,
  @policyNum = @policyNum
```

> The procedure body resides in the SQL Server (BDS) database; it was not retrievable for this run.

## Operations and processes
- [Authorize user for policy](../operations-processes.md)

## Business rules
- [BR-VP-005: Access granted per user-access-level matrix](../business-rules.md#br-vp-005-access-granted-per-user-access-level-matrix)

## Sources
- `SAIF.Business.View.Policy/clsPolicySecurity.vb`
